#pragma once

#include <iostream>
#include <functional>

using cb_t = std::function<void(int _sock,std::string clientIp,uint16_t clientPort)>;

class Task
{
public:
    Task()
    {}

    Task(int sock,std::string clientIp,uint16_t clientPort,cb_t cb)
        :_sock(sock)
        ,_clientIp(clientIp)
        ,_clientPort(clientPort)
        ,_cb(cb)
    {}

    void operator()()
    {
        _cb(_sock,_clientIp,_clientPort);
    }
    
    ~Task()
    {}
private:
    int _sock;
    std::string _clientIp;
    uint16_t _clientPort;
    cb_t _cb;
};

